package com.cusc.module_apply.factory;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.lifecycle.LifecycleOwner;

import com.cusc.module_apply.BR;
import com.cusc.module_apply.R;
import com.cusc.module_apply.model.ApplyMainModel;
import com.tcgroup.phone.base_core.widget.factory.TabItemViewFactory;

/**
 * 作者: wangfei
 * 创建时期: 2020/4/17.
 * 包名: com.cusc.module_apply.factory
 * 类名: OSAndroidMvvm
 */
public class ApplyTabItemViewFactory extends TabItemViewFactory<ApplyMainModel> {

    public LifecycleOwner mLifecycleOwner;

    public ApplyTabItemViewFactory(LifecycleOwner lifecycleOwner) {
        mLifecycleOwner = lifecycleOwner;
    }

    @Override
    public View inflateView(Context context, ApplyMainModel model) {
       ViewDataBinding binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.tb_item_view_01,null,false);
        binding.setLifecycleOwner(mLifecycleOwner);
        binding.setVariable(BR.model,model);
        return  binding.getRoot();
    }

}
